<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

Route::get('/login', 'home\loginController@index');
Route::post('/login', 'home\loginController@login');
Route::get('/logout', 'home\loginController@logout');

Route::get('/showData', function () {
    return view('home\showData');
});
Route::get('/getData', function () {
    return view('home\getData');
});
Route::get('/logo', 'manage\appController@logo');

Route::get('/', function () {
    return view('home\index');
});

Route::group(['namespace' => 'home', 'middleware' => 'home'], function () {
    Route::get('/special', function () {
        return view('home\special');
    });
    Route::get('/followApp',"followController@index");
    Route::get('/hotApp', function () {
        return view('home\hotApp');
    });
    Route::get('/details',"detailsController@index");
    Route::get('/changePass',"myController@changePass");
    Route::get('/myFollow',"myController@myFollow");
    Route::get('/myWords','myController@myWords');

    Route::get('/task',function (){
        return view('home\task');
    });
});

Route::group(['prefix' => 'ajax', 'middleware' => 'home'], function () {
    Route::post('/getCommentCount','home\ajaxController@getCommentCount');
    Route::post('/getComment','home\ajaxController@getComment');
    Route::post('/getHotWords','home\ajaxController@getHotWords');
    Route::post('/getRankCount','home\ajaxController@getRankCount');
    Route::post('/getFollow','home\ajaxController@getFollow');
    Route::post('/getFollowMyWords','home\ajaxController@getFollowMyWords');
    Route::post('/getMyWords','home\ajaxController@getMyWords');
    Route::post('/deleteFollowMywords','home\ajaxController@deleteFollowMywords');
    Route::post('/deleteMywords','home\ajaxController@deleteMywords');
    Route::post('/addToFollowWords','home\ajaxController@addToFollowWords');
    Route::post('/addMyWords','home\ajaxController@addMyWords');
    Route::post('/addToFollowApps','home\ajaxController@addToFollowApps');
    Route::post('/deleteFollowApps','home\ajaxController@deleteFollowApps');
    Route::post('/getGroupCount','home\ajaxController@getGroupCount');
    Route::post('/specialApp','home\ajaxController@specialApp');
});

//后台登陆界面路由
Route::get('/manage/login', 'manage\loginController@login');
Route::post('/manage/doLogin', 'manage\loginController@doLogin');

/**
 * 后台管理路由组
 */
Route::group(['prefix' => 'manage', 'namespace' => 'manage', 'middleware' => 'manage'], function () {
    Route::get('/', 'indexController@index');
    Route::get('/index', 'indexController@index');
    Route::get('/user', 'userController@index');
    Route::get('/head', 'userController@head');
    Route::get('/logo', 'appController@logo');
    Route::get('/userDel', 'userController@userDel');
    Route::any('/userEdit', 'userController@userEdit');
    Route::post('/headUpload', 'userController@headUpload');
    Route::any('/group', 'groupController@index');
    Route::get('/groupDel', 'groupController@groupDel');
    Route::any('/app', 'appController@index');
    Route::any('/appDel', 'appController@appDel');
    Route::any('/excel', 'excelController@index');
    Route::get('/comment-form-net', 'commentController@index');
    Route::post('/getData', 'commentController@getData');
    Route::post('/save-comment', 'commentController@saveComment');
    Route::get('/addwords', 'wordController@index');

    Route::post('/getWords','wordController@getWords');
    Route::post('/addWords','wordController@addWords');
    Route::post('/deleteWords','wordController@deleteWords');
});